package com.zj.fx.model.info;

import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class InfoSubcompany implements Serializable {
    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "主键id")
    private String id;

    @ApiModelProperty(value = "分公司编码")
    private String num;

    @ApiModelProperty(value = "分公司名称")
    private String name;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "启停用状态（0：停用，1：启用）")
    private String state;

    @ApiModelProperty(value = "备注")
    private String memo;

    public InfoSubcompany(String id, String num, String name, Date createTime, String state, String memo) {

        this.id = id;

        this.num = num;

        this.name = name;

        this.createTime = createTime;

        this.state = state;

        this.memo = memo;

    }

    public InfoSubcompany() {
        super();
    }

    public InfoSubcompany(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public String dateToStringConvert(Date date) {
        if (date != null) {
            return DateUtil.format(date, "yyyy-MM-dd HH:mm:ss");
        }
        return "";
    }


}